home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2003 November / PCWK1103B.iso / DesignCAD 3D Max PLUS trial 30 / DATA1.CAB / Example_Files / Sample_Macros / 3D Bounding Box.d3m < prev    next >
Encoding:
Text File  |  2003-09-29  |  858 b   |  30 lines

  1. ' This simple macro draws a 3D Bounding box around the object you select.
  2. '
  3. ' This macro works fine in 3D mode, since all lines in 3D
  4. ' Mode are of zero width.  If you use this macro in 2D Mode, 
  5. ' you can get results which you may not expect, since SYS 
  6. ' functions 196-201 use the boundary of the items, NOT their
  7. ' point locations, and points for wide lines are set in their
  8. ' middles, not on either side of the wide line, until exploded.
  9. '
  10. ' Make sure something is selected before going on 
  11.     if Sys(80) = 0 then
  12.         Message "Please select an object before using this macro."
  13.         goto Ender
  14.     endif
  15. ' Get Values about selected item
  16.     MinX = Sys(196)
  17.     MinY = Sys(197)
  18.     MaxX = Sys(198)
  19.     MaxY = Sys(199)
  20.     MinZ = Sys(200)
  21.     MaxZ = Sys(201)
  22. ' Draw 3D Box
  23.     >Box
  24.     {
  25.     <Pointxyz [MinX, MinY, MinZ]
  26.     <Pointxyz [MaxX, MaxY, MaxZ]
  27.     }
  28. Ender:
  29. End
  30.